home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / game.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-30  |  2.1 KB  |  96 lines

  1. #ifndef _game_h
  2. #define _game_h
  3.  
  4. #ifndef _vec2_h
  5. #    include "vec2.h"
  6. #endif
  7.  
  8. #ifndef _keeper_h
  9. #    include "keeper.h"        // for inlines
  10. #endif
  11.  
  12. class Ball;
  13. class XWall;
  14. class YWall;
  15.  
  16. class Game {
  17.     public:
  18.         Game(double wx=100., double wy=80.);
  19.         virtual ~Game();
  20.  
  21.         virtual const Real & GetPresetA()                const;
  22.         virtual const Real & GetPresetHaft()            const;
  23.         virtual const Real & GetSlowGranularity()        const;
  24.         virtual const Real & GetNormalBallSize()         const;
  25.  
  26.         virtual const Real& GetChargeGranularity()    const;
  27.         virtual const Real& GetChargeSpeed()            const;
  28.         virtual const Real& GetMaxCharge()                const;
  29.         virtual const Real& GetShootTime()                const;
  30.  
  31.         virtual const Real AreaOffX() const   = 0;
  32.         virtual const Real AreaOffY() const   = 0;
  33.         virtual const Real AreaWidth() const  = 0;
  34.         virtual const Real AreaHeight() const = 0;
  35.         Vec2 Edge( int i ) const;
  36.         Vec2 Mid( int i ) const;
  37.  
  38.         virtual void InitPlayground();
  39.         virtual void DrawBackground() const;
  40.  
  41.         void ExposeRedraw() const;
  42.         void ResizeRedraw() const;
  43.  
  44.         void ShowInfo( char *str ) const;
  45.         void ShowInfoIf( char *str ) const {
  46. #            ifdef DEBUG
  47.                 if (debug&GameState)
  48. #            endif
  49.                         ShowInfo(str);
  50.         }
  51.  
  52.         virtual void ShootBall( Ball *b );
  53.         virtual void PressedBall( Ball *b );
  54.         virtual void TouchedBall( Ball *b );
  55.         virtual void HitWall( Ball *b );
  56.         virtual void StartBall( Ball *b );
  57.         virtual void StopBall( Ball *b );
  58.         virtual void InPocket( Ball *b );
  59.         virtual void AllBallsStopped();
  60.         virtual int  IsSelectable( Ball *B );
  61.  
  62.     // Durchreichen der Keeper-Funktionalitaet
  63.         void TakeOffBoard(Ball *b)        { keeper->TakeOffBoard(b); }
  64.  
  65.     protected:
  66.         ColorId    floor;
  67.  
  68.         Keeper    *keeper;
  69.  
  70.     private:
  71.         int    running_balls;
  72.  
  73.     public:
  74.         static Real PresetA;
  75.         static Real PresetHaft;
  76.         static Real SlowGranularity;
  77.         static Real NormalBallSize;
  78.  
  79.         static Real    ChargeGranularity;    // LΣnge eines Ladeschritts
  80.         static Real ChargeSpeed;            // Einheiten pro Sekunde (Aufladen)
  81.         static Real    MaxCharge;                // maximale Ladung
  82.         static Real ShootTime;                // Zeit der Entladeanimation
  83.  
  84.  
  85.         XWall    *x1, *x2;
  86.         YWall    *y1, *y2;
  87.  
  88. #ifdef __TURBOC__
  89.         void *buffer;
  90. #endif
  91. };
  92.  
  93. extern Game    *g;
  94.  
  95. #endif
  96.